import React from 'react'
import styles from '../../styles/login/showLoginedUser.scss'
import { userDataConfig } from '../common/Header'
import { IconFont, success } from '../common/config'
import Label from '../common/Label'
import Router from 'next/router'

export default function ShowLoginedUser({ userData }: { userData: userDataConfig }) {
    const handleLogin = () =>{
        Router.push('/home');
        success('登录成功');
    }
    return (
        <div className={styles.layout} onClick={handleLogin}>
            <div className={styles.infoShow}>
                <img src={userData.avatar} alt="头像" className={styles.avatar} />
                <div>
                    <Label value={userData.identify} />
                    <p className={styles.realName}>{userData.real_name}</p>
                </div>
            </div>
            <IconFont type='iconjiantou' className={styles.icon} />
        </div>
    )
}
